/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Math;

/**
 *
 * @author gamas
 */
public class FormulaGeneral {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        int a=1;
        int b=2;
        int c=1;
        double x;
        x=(-b+(Math.sqrt(Math.pow(b,2)-(4*a*c))))/2*a;
        System.out.println("Resultado con positivo"+x);

        x=(-b-(Math.sqrt(Math.pow(b, 2)-(4*a*c))))/2*a;
        System.out.println("Resultado con negativo"+x);

    }

}
